import request from '../../utils/request'
import { generateRandomCodeForValidateCode } from '../../utils/randomCodeGenerator'
const api_name = "admin"

/**用户登录 */
export function login(admininfo) {
    return request({
        url: `/${api_name}/login`,
        method: 'post',
        data: admininfo,
        headers: {
            action: "login"
        }
    })
}

/** 获取用户信息*/
export function getInfo(token) {
    return request({
        url: `/${api_name}/info`,
        method: 'get',
        params: { token }
    })
}
/** 后台用户登出*/
export function logout() {
    return request({
        url: `/${api_name}/logout`,
        method: 'post'
    })
}

/**发送短信验证码 */
export function sendSMSCode(mobile) {
    return request({
        url: `/${api_name}/smscode/${mobile}`,
        method: 'get'
    })
}
